<template>
  <div>
      <!-- {{datas}} -->
            
      <ul>
          <li  v-for="i in datas" :key="i.id">{{ i.name }}
              <van-button @click="audit(i.id)">审核</van-button>
          </li>

      </ul>



      <van-dialog v-model:show="show" title="审核" show-cancel-button>

          <van-field :label="描述信息" v-model="descipt"/>
          <van-radio-group v-model="is_agree"> 
                <van-radio name="2"> 通过 </van-radio>
                <van-radio name="3"> 未通过 </van-radio>
                <van-button @click="submit"> 提交 </van-button>
            
            </van-radio-group>
      </van-dialog>

  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            datas:[],
            show:false,
            descipt:'',
            is_agree:2,
            id:0,
        }
    },
    methods:{
        
        // 获取信息
        getcustomer(){
             axios.get('http://localhost:8000/showuserudit/').then(res=>{
                    this.datas = res.data.list
                    console.log(this.datas);
            })        
        },
        
        // 点击
        audit(id){
            
            this.id = id
            this.show = true
        },

        // 提交
        submit(){

            axios.post('http://localhost:8000/audit/',{'id':this.id,'descipt':this.descipt,'is_agree':this.is_agree}).then(res=>{
                console.log(res);
            })
        }

    },
    mounted(){
        this.getcustomer()
    }
    

}
</script>

<style>

</style>